package com.lz.ccjdemo.http.api;

import com.lz.ccjdemo.data.CodeData;
import com.lz.ccjdemo.http.data.BaseResultData;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface BaseApiService {
    /**
     *
     */
    @GET("{path}")
    Observable<BaseResultData<Object>> get(@Path(value = "path",encoded = true) String path);

    @GET("{path}")
    Observable<BaseResultData<Object>> get(@Path(value = "path",encoded = true) String path,
                                           @QueryMap Map<String,Object> map);

    @POST("{path}")
    Observable<BaseResultData<Object>> post(@Path(value = "path",encoded = true) String path,@Body RequestBody body);

    @POST("{path}")
    Observable<BaseResultData<Object>> post(@Path(value = "path",encoded = true) String path,@QueryMap Map<String,Object> map,
                                            @Body RequestBody body);

}
